<?php $app = isset($_GET['app']) ? $_GET['app'] : ''; ?>
<div id="vj_left">
    <?php
    foreach (Yii::app()->user->getFlashes() as $key => $message) {
        echo '<div style="color:blue;font-weight:bold;display:none" class="flash-' . $key . '">' . $message . "</div>\n";
    }
    ?>
    <script type="text/javascript">
        var $html = $(".flash-success").html();
        if ($.trim($html) != '' && $html != undefined) {
            alert($html);
        }
    </script>
    <?php if ($app == '' || $app == 'shopping') { ?>
        <div class="box_two_650">
            <?php $this->widget('WidgetCategories'); ?>
            <div class="box_js_450">
                <?php $this->widget('WidgetBanner'); ?>

                <div class="widget-product-no-image" style="padding-top: 10px">
                    <?php foreach ($products as $product) { ?>
                        <div class="product-no-image-wrapper">
                            <div style="display:inline-block">
                                <img
                                    src="<?php echo TreTodayUrl::home() . '/pictures/new.png' ?>"
                                    alt="new">
                            </div>
                            <div class="product-no-image-content" style="  ">
                                <a style="color: black"
                                   href="<?php echo TreTodayUrl::getProductUrl($product->product_id, $product->product_name) ?>">
                                    <?php echo $product->product_name ?>
                                </a>
                            </div>
                        </div>

                    <?php } ?>
                    <div style="text-align: right">
                        <a href="<?php echo TreTodayUrl::getLatestProductsUrl() ?>">Xem thêm</a>

                    </div>

                </div>
            </div>
        </div>
    <?php } elseif ($app == 'computer' || $app == 'dientu') { ?>
        <?php $this->widget('WidgetWideCategories'); ?>
        <div class="vj_box_266_h">
            <?php $this->widget('WidgetBestSeller', array('category' => $app)); ?>
            <?php $this->widget('WidgetNewProduct', array('category' => $app)); ?>
        </div>

    <?php } ?>

    <?php if ($app == 'shopping') {
        $this->widget('WidgetTopCategoriesPosition', array('position' => 'top-shopping'));
    } else {
        $this->widget('WidgetTopCategoriesPosition', array('position' => 'top-raovat'));
    } ?>

    <div id="vj_banner02">
        <a target="_blank" href="http://vietliveradio.com" id="href_img">
            <img src="images/vietlive.gif" id="linkimg" alt="VietliveRadio.com">
        </a>
        <script type="text/javascript">
            var linkimg = new Array("<?php echo TreTodayUrl::home().'/images/vietlive.gif'?>", "<?php echo TreTodayUrl::home().'/images/top_468x60_10.gif'?>");
            var hrefimg = new Array("http://vietliveradio.com", "http://www.thanhtoan.us");
            var alt = new Array("VietliveRadio.com", "thanhtoan.us");
            var source = document.getElementById('linkimg');
            var path = document.getElementById('href_img');
            var i = 0;
            i = Math.floor((Math.random() * 2) + 1) - 1;
            source.src = linkimg[i];
            source.alt = alt[i];
            path.href = hrefimg[i];
        </script>
    </div>
    <?php $this->widget('WidgetLatestUpdate') ?>
    <?php $this->widget('WidgetShopTypical') ?>

    <?php if (isset($_GET['app']) && ($_GET['app'] == 'dientu' || $_GET['app'] == 'computer')) { ?>
        <div class="content" style="margin: 20px 0 0 0">
            <div class="custom">

                <div style="text-align: center;">
                    <a target="_blank" title="Phone v247"
                       href="http://phonev247.com">
                        <img
                            src="<?php echo TreTodayUrl::home() . "/pictures/ttbanner.gif" ?>" alt="ttbanner"
                            width="295" height="98"/>
                    </a>
                    <a target="_blank"
                       href="http://tretoday.com">
                        <img width="295" height="98"
                             src="<?php echo TreTodayUrl::home() . "/pictures/t1.gif" ?>" alt="tretoday.com"/>
                    </a>
                </div>
            </div>
        </div>
    <?php } ?>

</div>
</div>

<div id="vj_right">
    <?php $this->widget('WidgetUpProduct'); ?>
    <?php if (!isset($_GET['app'])) {
        $this->widget('WidgetTreTodayRSS');
        $this->widget('WidgetExchange');
//        $this->widget('WidgetService');
        $this->widget('WidgetRightAds');
    } elseif (isset($_GET['app']) && $_GET['app'] == 'shopping') {
        $this->widget('WidgetTopBranch');
        $this->widget('WidgetRightAds');
    } else {
        $this->widget('WidgetTreTodayRSS');
        $this->widget('WidgetExchange');
        $this->widget('WidgetService');
        $this->widget('WidgetRightAds');
    }?>

</div>
<div class="vj_box_three_ul_300" id="vj_box_three_ul_300">
    <ul>
        <li>
            <a href="http://traodoibanner.com" target="_blank" title="Trao dổi banner">
                <img
                    alt="trao đổi banner"
                    src="<?php echo TreTodayUrl::home() . '/images/traodoibanner_com.gif' ?>"/>
            </a>
        </li>
        <li class="vj_banner_ul_300x100">
            <a href="http://muahangmy.com" target="_blank" title="Mua hàng mỹ">
                <img alt="mua hàng mỹ"
                     src="<?php echo TreTodayUrl::home() . '/images/muahangmy_com.gif' ?>"/>
            </a>
        </li>
        <li>
            <a href="http://nhactogo.com" target="_blank" title="Nhạc to go">
                <img alt="nhạc togo"
                     src="<?php echo TreTodayUrl::home() . '/images/nhactogo_com.gif' ?>"/>
            </a>
        </li>
    </ul>

</div>
